//------------------------------------------------------------------------------
// X2TK Graphic Toolkit
// Copyright (C) 2006-2007 Janusz Kowalski
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------

#include "x2tk_Container.h"
#include "x2tk_Button.h"
#include "imgSDL.h"

#ifndef X2TK_WINDOW_H
#define X2TK_WINDOW_H

// Simple window widget.
// (Dragabble, closeable)

// Okienko zapewnia dowolnemu kontenerowi tytuł, możliwość przemieszczania
// oraz zmiany rozmiaru.

namespace x2tk {

class Window : public Container {
  private:
    const char *title_;
    Widget *content_;
    Button *closeBtn_;
    Widget *resizeBar_;
    Widget *moveBar_;
    void rearrange();
    Image tex;
    Font font_;
  public:
    Window(const char *title, int x, int y, int w, int h);
    virtual void draw(GraphicContext &g);
    void setContent(Widget *content);
    virtual void resize(int w, int h);
    virtual void action(int id, Widget *origin);
};

} // namespace x2tk

#endif
